local skel = fk.CreateSkill {
  name = "rmt__jinghua",
  tags = {Skill.Compulsory},
}

local spec = {
  can_trigger = function(self, event, target, player, data)
    return player:hasSkill(skel.name) and player == target
  end,
  on_use = function (self, event, target, player, data)
    data:changeDamage(1)
    if data.damage >= data.to.hp + data.to.shield then
      if not player:isKongcheng() then
        local prevent = false
        if #player:getCardIds("h") > 4 then prevent = true end
        local num = player.room:recastCard(player:getCardIds("h"), player, skel.name)
        if prevent then
          data:preventDamage()
        end
      end
    end
  end,
}

skel:addEffect(fk.DamageCaused, spec)
skel:addEffect(fk.DamageInflicted, spec)

Fk:loadTranslationTable{
  ["rmt__jinghua"] = "镜华",
  [":rmt__jinghua"] = "锁定技，你造成或受到伤害时，均+1；你造成或受到致命伤害时，须重铸所有手牌，若大于4，防止此伤害。",

  ["$rmt__jinghua1"] = " ",
  ["$rmt__jinghua2"] = " ",
}

return skel
